package org.faradel.pharmapp.entities;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.springframework.stereotype.Component;

/**
 * The persistent class for the Supplier database table.
 * 
 */
@Entity
@Table(name = "Supplier")
@Component
public class Supplier implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int supplier_Id;

    private String supplier_address;

    private String supplier_city;

    private String supplier_country;

    private String supplier_email;

    private String supplier_name;

    private String supplier_phone1;

    private String supplier_phone2;

    private String supplier_state;

    private String supplier_webAddress;

    private String supplier_zip;

    // bi-directional many-to-one association to MedicationInventory
    @OneToMany(mappedBy = "supplier")
    private List<MedicationInventory> medicationInventories;

    // bi-directional many-to-one association to OrderMed
    @OneToMany(mappedBy = "supplier")
    private List<OrderMedication> orderMeds;

    public Supplier()
    {
    }

    public int getSupplier_Id()
    {
        return this.supplier_Id;
    }

    public void setSupplier_Id(int supplier_Id)
    {
        this.supplier_Id = supplier_Id;
    }

    public String getSupplier_address()
    {
        return this.supplier_address;
    }

    public void setSupplier_address(String supplier_address)
    {
        this.supplier_address = supplier_address;
    }

    public String getSupplier_city()
    {
        return this.supplier_city;
    }

    public void setSupplier_city(String supplier_city)
    {
        this.supplier_city = supplier_city;
    }

    public String getSupplier_country()
    {
        return this.supplier_country;
    }

    public void setSupplier_country(String supplier_country)
    {
        this.supplier_country = supplier_country;
    }

    public String getSupplier_email()
    {
        return this.supplier_email;
    }

    public void setSupplier_email(String supplier_email)
    {
        this.supplier_email = supplier_email;
    }

    public String getSupplier_name()
    {
        return this.supplier_name;
    }

    public void setSupplier_name(String supplier_name)
    {
        this.supplier_name = supplier_name;
    }

    public String getSupplier_phone1()
    {
        return this.supplier_phone1;
    }

    public void setSupplier_phone1(String supplier_phone1)
    {
        this.supplier_phone1 = supplier_phone1;
    }

    public String getSupplier_phone2()
    {
        return this.supplier_phone2;
    }

    public void setSupplier_phone2(String supplier_phone2)
    {
        this.supplier_phone2 = supplier_phone2;
    }

    public String getSupplier_state()
    {
        return this.supplier_state;
    }

    public void setSupplier_state(String supplier_state)
    {
        this.supplier_state = supplier_state;
    }

    public String getSupplier_webAddress()
    {
        return this.supplier_webAddress;
    }

    public void setSupplier_webAddress(String supplier_webAddress)
    {
        this.supplier_webAddress = supplier_webAddress;
    }

    public String getSupplier_zip()
    {
        return this.supplier_zip;
    }

    public void setSupplier_zip(String supplier_zip)
    {
        this.supplier_zip = supplier_zip;
    }

    public List<MedicationInventory> getMedicationInventories()
    {
        return this.medicationInventories;
    }

    public void setMedicationInventories(List<MedicationInventory> medicationInventories)
    {
        this.medicationInventories = medicationInventories;
    }

    public MedicationInventory addMedicationInventory(MedicationInventory medicationInventory)
    {
        getMedicationInventories().add(medicationInventory);
        medicationInventory.setSupplier(this);

        return medicationInventory;
    }

    public MedicationInventory removeMedicationInventory(MedicationInventory medicationInventory)
    {
        getMedicationInventories().remove(medicationInventory);
        medicationInventory.setSupplier(null);

        return medicationInventory;
    }

    public List<OrderMedication> getOrderMeds()
    {
        return this.orderMeds;
    }

    public void setOrderMeds(List<OrderMedication> orderMeds)
    {
        this.orderMeds = orderMeds;
    }

    public OrderMedication addOrderMed(OrderMedication orderMed)
    {
        getOrderMeds().add(orderMed);
        orderMed.setSupplier(this);

        return orderMed;
    }

    public OrderMedication removeOrderMed(OrderMedication orderMed)
    {
        getOrderMeds().remove(orderMed);
        orderMed.setSupplier(null);

        return orderMed;
    }

}